<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_ymodem.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f2a2cc749b6bfcea90db6730434b0bd6.html">core</a></li><li class="navelem"><a class="el" href="dir_37b66dfbfdffce01c33ebea49c49c2c3.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_ymodem.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__ymodem_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef __B_YMODEM_H__</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define __B_YMODEM_H__</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__config_8h.html">b_config.h</a>&quot;</span>  </div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#if _YMODEM_ENABLE</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structb_ymodem128_info__t.html">   57</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;{</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structb_ymodem128_info__t.html#a87bdcb2d9de9c3eef834e0af26f2d5e3">   59</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem128_info__t.html#a87bdcb2d9de9c3eef834e0af26f2d5e3">soh</a>;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="structb_ymodem128_info__t.html#af57eaec6f3dec6de717735725c9908a6">   60</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem128_info__t.html#af57eaec6f3dec6de717735725c9908a6">number</a>;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="structb_ymodem128_info__t.html#ae817be61f4d69f01a76ff417b23f5a54">   61</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem128_info__t.html#ae817be61f4d69f01a76ff417b23f5a54">xnumber</a>;</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="structb_ymodem128_info__t.html#ab02bda4989472488cf520fd11c64a230">   62</a></span>&#160;    uint8_t dat[128];</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="structb_ymodem128_info__t.html#a8b556a1f624d837372d1b7d09c747c8f">   63</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem128_info__t.html#a8b556a1f624d837372d1b7d09c747c8f">crc_h</a>;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structb_ymodem128_info__t.html#aac2e6315c9d2f111fa40efaf5135ca54">   64</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem128_info__t.html#aac2e6315c9d2f111fa40efaf5135ca54">crc_l</a>;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}<a class="code" href="structb_ymodem128_info__t.html">bYmodem128Info_t</a>;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="structb_ymodem1k_info__t.html">   68</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;{</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="structb_ymodem1k_info__t.html#a0016500d356f9144ad98cf2db5243a70">   70</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem1k_info__t.html#a0016500d356f9144ad98cf2db5243a70">stx</a>;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structb_ymodem1k_info__t.html#af57eaec6f3dec6de717735725c9908a6">   71</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem1k_info__t.html#af57eaec6f3dec6de717735725c9908a6">number</a>;</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structb_ymodem1k_info__t.html#ae817be61f4d69f01a76ff417b23f5a54">   72</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem1k_info__t.html#ae817be61f4d69f01a76ff417b23f5a54">xnumber</a>;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="structb_ymodem1k_info__t.html#a37f244daf59ff3faefec610b32f52584">   73</a></span>&#160;    uint8_t dat[1024];</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structb_ymodem1k_info__t.html#a8b556a1f624d837372d1b7d09c747c8f">   74</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem1k_info__t.html#a8b556a1f624d837372d1b7d09c747c8f">crc_h</a>;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structb_ymodem1k_info__t.html#aac2e6315c9d2f111fa40efaf5135ca54">   75</a></span>&#160;    uint8_t <a class="code" href="structb_ymodem1k_info__t.html#aac2e6315c9d2f111fa40efaf5135ca54">crc_l</a>;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;}<a class="code" href="structb_ymodem1k_info__t.html">bYmodem1kInfo_t</a>;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___types_definitions.html#gad74fcad348f660a999a9903fa1c5c1ac">   80</a></span>&#160;<span class="keyword">typedef</span> void (*<a class="code" href="group___y_m_o_d_e_m___exported___types_definitions.html#gad74fcad348f660a999a9903fa1c5c1ac">pymcb_t</a>)(uint8_t t, uint8_t number, uint8_t *pbuf, uint16_t len); </div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___types_definitions.html#ga2429c212fbcca5113135547532d6181b">   81</a></span>&#160;<span class="keyword">typedef</span> void (*<a class="code" href="group___y_m_o_d_e_m___exported___types_definitions.html#ga2429c212fbcca5113135547532d6181b">pymsend</a>)(uint8_t cmd);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga5414d3902197595ea48ec719124a020a">   92</a></span>&#160;<span class="preprocessor">#define YMODEM_SOH   0x01</span></div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga46cda4642619d191b299108adb82f790">   93</a></span>&#160;<span class="preprocessor">#define YMODEM_STX   0x02</span></div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga04afd425b4fd8aaf0295d2a5da136b48">   94</a></span>&#160;<span class="preprocessor">#define YMODEM_EOT   0x04</span></div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga21dc6d57d20876824cacb17e0557afaa">   95</a></span>&#160;<span class="preprocessor">#define YMODEM_ACK   0x06</span></div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga914e00758ffecbdc9a0a7b7c390ee68a">   96</a></span>&#160;<span class="preprocessor">#define YMODEM_NAK   0x15</span></div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#gac68fa72e4aba50a90e6f144ee191506d">   97</a></span>&#160;<span class="preprocessor">#define YMODEM_CAN   0x18</span></div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga50e74d6ae11e478269546267299d0c38">   98</a></span>&#160;<span class="preprocessor">#define YMODEM_C     0x43</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga31ac0630de7a3813426ffddc375eea83">  101</a></span>&#160;<span class="preprocessor">#define YMODEM_FILENAME     0</span></div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="group___y_m_o_d_e_m___exported___defines.html#ga2d5546aa52186a0da1d4ab08bac82343">  102</a></span>&#160;<span class="preprocessor">#define YMODEM_FILEDATA     1</span></div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___y_m_o_d_e_m___exported___functions.html#gaf6a838b07581ba33b8eef73401588b19">bYmodemInit</a>(<a class="code" href="group___y_m_o_d_e_m___exported___types_definitions.html#gad74fcad348f660a999a9903fa1c5c1ac">pymcb_t</a> fcb, <a class="code" href="group___y_m_o_d_e_m___exported___types_definitions.html#ga2429c212fbcca5113135547532d6181b">pymsend</a> fs);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___y_m_o_d_e_m___exported___functions.html#ga73c58a30399bd5d24cc1105db4d5b137">bYmodemParse</a>(uint8_t *pbuf, uint16_t len);</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___y_m_o_d_e_m___exported___functions.html#ga3fbe65872c4c467041e8023d8e87477e">bYmodemStart</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___y_m_o_d_e_m___exported___functions.html#ga9c639ac387c903a4daa463db207108f1">bYmodemStop</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    }</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160; </div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="preprocessor">#endif  </span></div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="ttc" id="structb_ymodem128_info__t_html_aac2e6315c9d2f111fa40efaf5135ca54"><div class="ttname"><a href="structb_ymodem128_info__t.html#aac2e6315c9d2f111fa40efaf5135ca54">bYmodem128Info_t::crc_l</a></div><div class="ttdeci">uint8_t crc_l</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00064">b_ymodem.h:64</a></div></div>
<div class="ttc" id="structb_ymodem128_info__t_html_a8b556a1f624d837372d1b7d09c747c8f"><div class="ttname"><a href="structb_ymodem128_info__t.html#a8b556a1f624d837372d1b7d09c747c8f">bYmodem128Info_t::crc_h</a></div><div class="ttdeci">uint8_t crc_h</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00063">b_ymodem.h:63</a></div></div>
<div class="ttc" id="group___y_m_o_d_e_m___exported___types_definitions_html_gad74fcad348f660a999a9903fa1c5c1ac"><div class="ttname"><a href="group___y_m_o_d_e_m___exported___types_definitions.html#gad74fcad348f660a999a9903fa1c5c1ac">pymcb_t</a></div><div class="ttdeci">void(* pymcb_t)(uint8_t t, uint8_t number, uint8_t *pbuf, uint16_t len)</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00080">b_ymodem.h:80</a></div></div>
<div class="ttc" id="group___y_m_o_d_e_m___exported___functions_html_ga9c639ac387c903a4daa463db207108f1"><div class="ttname"><a href="group___y_m_o_d_e_m___exported___functions.html#ga9c639ac387c903a4daa463db207108f1">bYmodemStop</a></div><div class="ttdeci">int bYmodemStop(void)</div></div>
<div class="ttc" id="structb_ymodem1k_info__t_html_af57eaec6f3dec6de717735725c9908a6"><div class="ttname"><a href="structb_ymodem1k_info__t.html#af57eaec6f3dec6de717735725c9908a6">bYmodem1kInfo_t::number</a></div><div class="ttdeci">uint8_t number</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00071">b_ymodem.h:71</a></div></div>
<div class="ttc" id="structb_ymodem1k_info__t_html_aac2e6315c9d2f111fa40efaf5135ca54"><div class="ttname"><a href="structb_ymodem1k_info__t.html#aac2e6315c9d2f111fa40efaf5135ca54">bYmodem1kInfo_t::crc_l</a></div><div class="ttdeci">uint8_t crc_l</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00075">b_ymodem.h:75</a></div></div>
<div class="ttc" id="b__config_8h_html"><div class="ttname"><a href="b__config_8h.html">b_config.h</a></div></div>
<div class="ttc" id="structb_ymodem128_info__t_html_ae817be61f4d69f01a76ff417b23f5a54"><div class="ttname"><a href="structb_ymodem128_info__t.html#ae817be61f4d69f01a76ff417b23f5a54">bYmodem128Info_t::xnumber</a></div><div class="ttdeci">uint8_t xnumber</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00061">b_ymodem.h:61</a></div></div>
<div class="ttc" id="group___y_m_o_d_e_m___exported___functions_html_ga3fbe65872c4c467041e8023d8e87477e"><div class="ttname"><a href="group___y_m_o_d_e_m___exported___functions.html#ga3fbe65872c4c467041e8023d8e87477e">bYmodemStart</a></div><div class="ttdeci">int bYmodemStart(void)</div></div>
<div class="ttc" id="structb_ymodem1k_info__t_html_a0016500d356f9144ad98cf2db5243a70"><div class="ttname"><a href="structb_ymodem1k_info__t.html#a0016500d356f9144ad98cf2db5243a70">bYmodem1kInfo_t::stx</a></div><div class="ttdeci">uint8_t stx</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00070">b_ymodem.h:70</a></div></div>
<div class="ttc" id="structb_ymodem1k_info__t_html_a8b556a1f624d837372d1b7d09c747c8f"><div class="ttname"><a href="structb_ymodem1k_info__t.html#a8b556a1f624d837372d1b7d09c747c8f">bYmodem1kInfo_t::crc_h</a></div><div class="ttdeci">uint8_t crc_h</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00074">b_ymodem.h:74</a></div></div>
<div class="ttc" id="structb_ymodem128_info__t_html"><div class="ttname"><a href="structb_ymodem128_info__t.html">bYmodem128Info_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00057">b_ymodem.h:57</a></div></div>
<div class="ttc" id="group___y_m_o_d_e_m___exported___functions_html_ga73c58a30399bd5d24cc1105db4d5b137"><div class="ttname"><a href="group___y_m_o_d_e_m___exported___functions.html#ga73c58a30399bd5d24cc1105db4d5b137">bYmodemParse</a></div><div class="ttdeci">int bYmodemParse(uint8_t *pbuf, uint16_t len)</div></div>
<div class="ttc" id="structb_ymodem128_info__t_html_a87bdcb2d9de9c3eef834e0af26f2d5e3"><div class="ttname"><a href="structb_ymodem128_info__t.html#a87bdcb2d9de9c3eef834e0af26f2d5e3">bYmodem128Info_t::soh</a></div><div class="ttdeci">uint8_t soh</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00059">b_ymodem.h:59</a></div></div>
<div class="ttc" id="structb_ymodem1k_info__t_html"><div class="ttname"><a href="structb_ymodem1k_info__t.html">bYmodem1kInfo_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00068">b_ymodem.h:68</a></div></div>
<div class="ttc" id="group___y_m_o_d_e_m___exported___functions_html_gaf6a838b07581ba33b8eef73401588b19"><div class="ttname"><a href="group___y_m_o_d_e_m___exported___functions.html#gaf6a838b07581ba33b8eef73401588b19">bYmodemInit</a></div><div class="ttdeci">int bYmodemInit(pymcb_t fcb, pymsend fs)</div></div>
<div class="ttc" id="group___y_m_o_d_e_m___exported___types_definitions_html_ga2429c212fbcca5113135547532d6181b"><div class="ttname"><a href="group___y_m_o_d_e_m___exported___types_definitions.html#ga2429c212fbcca5113135547532d6181b">pymsend</a></div><div class="ttdeci">void(* pymsend)(uint8_t cmd)</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00081">b_ymodem.h:81</a></div></div>
<div class="ttc" id="structb_ymodem1k_info__t_html_ae817be61f4d69f01a76ff417b23f5a54"><div class="ttname"><a href="structb_ymodem1k_info__t.html#ae817be61f4d69f01a76ff417b23f5a54">bYmodem1kInfo_t::xnumber</a></div><div class="ttdeci">uint8_t xnumber</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00072">b_ymodem.h:72</a></div></div>
<div class="ttc" id="structb_ymodem128_info__t_html_af57eaec6f3dec6de717735725c9908a6"><div class="ttname"><a href="structb_ymodem128_info__t.html#af57eaec6f3dec6de717735725c9908a6">bYmodem128Info_t::number</a></div><div class="ttdeci">uint8_t number</div><div class="ttdef"><b>Definition:</b> <a href="b__ymodem_8h_source.html#l00060">b_ymodem.h:60</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
